package panda.server.util.imageprocessing;

import java.io.File;
import java.util.List;

import panda.client.enumerations.MagicSet;
import panda.server.data.CardData;
import panda.server.data.MagicCardDB;

/**
 * Renames images acquired from the HQ Mtg Scanning Project at slightlymagic.net/forum from their name to their ID
 * number. For example, "Akrasan Squire.full.jpg" is renamed to "1.jpg".<br>
 * <br>
 * Still needs manual work with basic lands. They are in the format "Island1.jpg" to "Island4.jpg".
 * Also might need work on special character cases like Aethertow and Scornful Aether-Lich.
 *
 * @author zane.tian@gmail.com
 */
public class MtgInfoHqToIdImgRenamer
{

	public static void main(String[] args)
	{
		List<CardData> cards = MagicCardDB.getCardsFromSet(MagicSet.RISE_OF_THE_ELDRAZI);
		String fullHqImageRoot = "C:\\Users\\kyruru\\Desktop\\roe";

		for(CardData card : cards)
		{
			String name = card.getName();

			File currentFile = new File(fullHqImageRoot + "\\" + name + ".full.jpg");
			System.out.println(currentFile.getAbsolutePath());
			System.out.println(currentFile.renameTo(new File(fullHqImageRoot + "\\" + card.getID() + ".jpg")));

			/* this alternative version renames all files and takes out the .full */
			// System.out.println(currentFile.renameTo(new File(fullHqImageRoot + "\\" + name + ".jpg")));
		}
	}
}